package com.sa.token.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;

import static com.baomidou.mybatisplus.annotation.FieldFill.INSERT;

/**
 * <p>
 * 登录日志表
 * </p>
 *
 * @author xhs
 * @since 2021-12-29
 */
@Data
@Builder
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName(value = "sys_login_log",autoResultMap = true)
public class SysLoginLogEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 登录账号
     */
    @TableField("login_id")
    private String loginId;

    /**
     * 登录IP
     */
    @TableField("creator_ip")
    private String creatorIp;

    /**
     * 登录地址
     */
    @TableField("creator_address")
    private String creatorAddress;

    /**
     * 登录浏览器
     */
    @TableField("browser")
    private String browser;

    /**
     * 登录操作系统
     */
    @TableField("operating_system")
    private String operatingSystem;

    /**
     * 登录状态(1:成功,2:失败)
     */
    @TableField("status")
    private String status;

    /**
     * 操作信息
     */
    @TableField("message")
    private String message;

    /**
     * 登录日期
     */
    @TableField(value = "create_time", fill = INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;


}
